package addon.w3.mdx.com;

import java.io.IOException;

import addon.w3.mdx.LEDataInputStream;
import addon.w3.mdx.MDXException;
import addon.w3.mdx.MDXParentCOM;

/**
 *
 *--NRMS						// [Normals]
	long	nnrms;
	struct {
		float	x,y,z;
	} normals[nnrms];

 * @author madjk
 *
 */
public class MDXNormals extends MDXParentCOM {
	int length = -1;
	public MDXNormalCOM nrms[];
	
	public String getTag() {
		return "NRMS";
	}
	
	public void _decode(LEDataInputStream ins) throws IOException, MDXException {
		length = ins.readInt();
		nrms = new MDXNormalCOM[length];
		for(int i=0;i<nrms.length;i++) {
			nrms[i] = new MDXNormalCOM();
			nrms[i].decode(ins);
		}
	}
	
	public String toString() {
		StringBuffer sb = new StringBuffer();
		sb.append("TAG : "+getTag());
		sb.append("\n\tELEN : "+length);
		if(nrms != null && nrms.length > 0) sb.append("\n\tNRMS[] : "+nrms.length);
		return sb.toString();
	}

	@Override
	public boolean isImplicitTag() {
		// TODO Auto-generated method stub
		return true;
	}
}